﻿using System;
using Aso.TradingTerminalSuite.Common.Elastic;
using System.ComponentModel.Composition;

namespace Aso.TinyTester.Core.Configuration
{
	[PartCreationPolicy(CreationPolicy.NonShared)]
	
	public class UserConfiguration:ElasticObject
	{
		public UserConfiguration()
		{
			AddAttribute("Version",new ElasticObject{InternalValue = "1.0"});
			AddElement(new ElasticObject("Layout"));
		}

		public String Version
		{
			get { return (String)GetAttributeValue("Version"); }
			set {SetAttributeValue("Version",value); }
		}

		public ElasticObject Layout
		{
			get { return Element("Layout"); }
		}

		public UserConfiguration Clone()
		{
			var xml = ((dynamic) this) > FormatType.Xml;
			return xml.To<UserConfiguration>();
		}
	}
}
